package com.astn.bks;

import com.astn.bks.util.WebserviceUtils;
import com.astn.entity.booking.QuoteUser;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.Window;
import android.widget.Button;
import android.widget.ListView;

public class ProviderHome extends Activity {
	private Button btnLatestRequest;
	private Button btnMyOffer;
	private Button btnBack;
	private Button btnNext;
	private Intent providerService;
	private ListView lsv;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.providerhome);
		btnLatestRequest = (Button) findViewById(R.id.btnLatestRequest);
		btnMyOffer = (Button) findViewById(R.id.btnMyOffer);
		btnBack = (Button) findViewById(R.id.btnPreviousPage);
		btnNext = (Button) findViewById(R.id.btnNextPage);
		lsv = (ListView) findViewById(R.id.lsvProviderHome);
		if (WebserviceUtils.getUser().getType() == QuoteUser.PROVIDER) {
			providerService = new Intent(ProviderHome.this,
					ProviderService.class);
			startService(providerService);
		}
	}

	@Override
	public void onBackPressed() {
		super.onBackPressed();
		if (WebserviceUtils.getUser().getType() == QuoteUser.PROVIDER) {
			stopService(providerService);
		}
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.optmenuprovider, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case R.id.mnProviderMessage:
			pMessage();
			return true;
		case R.id.mnProviderHistory:
			pHistory();
			return true;
		case R.id.mnProviderPayment:
			pPayment();
			return true;
		case R.id.mnProviderSearch:
			pSearch();
			return true;
		case R.id.mnProviderHelp:
			pHeld();
			return true;
		default:
			return super.onOptionsItemSelected(item);
		}
	}

	private void pPostOffer() {

	}

	private void pMessage() {

	}

	private void pHistory() {

	}

	private void pPayment() {

	}

	private void pSearch() {

	}

	private void pHeld() {

	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
	}

}
